<div class="card text-white bg-dark mb-3 mt-1">
  <div class="card-body">
    <h5 class="card-title">Filter domains by date range :</h5>
    <p class="card-text">You can filter domains by a specified daterange. Display all domains if empty.</p>
    <form action="{{ url_for('crawler_splash.domains_explorer_post_filter') }}" method='post'>
      <div class="row">
        <div class="col-6">

          <div class="input-group" id="date-range-from">
            <div class="input-group-prepend"><span class="input-group-text"><i class="far fa-calendar-alt" aria-hidden="true"></i></span></div>
            <input class="form-control" id="date-range-from-input" placeholder="yyyy-mm-dd" value="{% if date_from %}{{ date_from[0:4] }}-{{ date_from[4:6] }}-{{ date_from[6:8] }}{% endif %}" name="date_from" autocomplete="off">
          </div>
          <div class="input-group" id="date-range-to">
            <div class="input-group-prepend"><span class="input-group-text"><i class="far fa-calendar-alt" aria-hidden="true"></i></span></div>
            <input class="form-control" id="date-range-to-input" placeholder="yyyy-mm-dd" value="{% if date_to %}{{ date_to[0:4] }}-{{ date_to[4:6] }}-{{ date_to[6:8] }}{% endif %}" name="date_to" autocomplete="off">
          </div>
        </div>
        <div class="col-6">
          <div class="custom-control custom-switch">
            <input class="custom-control-input" type="checkbox" name="domain_onion_switch" value="True" id="domain_onion_switch" {%if domain_type=='all' or domain_type=='onion'%}checked{%endif%}>
            <label class="custom-control-label" for="domain_onion_switch">
              <span class="badge badge-danger"><i class="fas fa-user-secret"></i> Onion Domains</span>
            </label>
          </div>
          <div class="custom-control custom-switch">
            <input class="custom-control-input" type="checkbox" name="domain_i2p_switch" value="True" id="domain_i2p_switch" {%if domain_type=='all' or domain_type=='i2p'%}checked{%endif%}>
            <label class="custom-control-label" for="domain_i2p_switch">
              <span class="badge badge-danger"><i class="fas fa-user-secret"></i> I2P Domains</span>
            </label>
          </div>
          <div class="custom-control custom-switch">
            <input class="custom-control-input" type="checkbox" name="domain_regular_switch" value="True" id="domain_regular_switch"{%if domain_type=='all' or domain_type=='regular'%}checked{%endif%}>
            <label class="custom-control-label" for="domain_regular_switch">
              <span class="badge badge-warning"><i class="fab fa-html5"></i> Web Domains</span>
            </label>
          </div>
        </div>
      </div>
      <div class="d-flex justify-content-between mt-2">
        <button class="btn btn-outline-light" type="button" onclick="$('#date-range-from-input').val('');$('#date-range-to-input').val('');"><i class="fas fa-trash-alt"></i></button>
        <button class="btn btn-secondary">
          <i class="fas fa-eye"></i> Filter Domains
        </button>
      </div>
    </form>
  </div>
</div>
